package com.abuaziz.librarys.base

import android.content.Context
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import me.ezitku.base.extensions.language.languageContext

abstract class AppBaseActivity : AppCompatActivity() {

    abstract fun getLayoutResId(): Int

    abstract fun init(view: View?, savedInstanceState: Bundle?)

    override fun attachBaseContext(newBase: Context) {
        super.attachBaseContext(newBase.languageContext())
        //
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(getLayoutResId())
        init(null, savedInstanceState)
    }
}